<?php
/* @var $this Laurent_OrderTickets_Block_Adminhtml_Order_View_Tab_Tickets */
/** @var $coreHelper Mage_Core_Helper_Data */
$coreHelper = Mage::helper('core');
?>
<div class="entry-edit">
    <div class="entry-edit-head">
        <h4><?php echo $this->__('Order tickets'); ?></h4>
    </div>
    <div class="fieldset fieldset-wide">
        <?php if ($this->hasChat()): ?>
            <table cellspacing="0" class="form-list">
                <tr>
                    <td class="label"><?php echo $this->__('Created at') ?></td>
                    <td class="value">
                        <?php echo $coreHelper->formatDate($this->getChat()->getCreatedAt(), 'full', true) ?>
                    </td>
                </tr>
                <tr>
                    <td class="label"><?php echo $this->__('Last answer date') ?></td>
                    <td class="value">
                        <?php echo $coreHelper->formatDate($this->getChat()->getLastAnswerDate(), 'full', true) ?>
                    </td>
                </tr>
                <tr>
                    <td class="label"><?php echo $this->__('Status') ?></td>
                    <td class="value"><?php echo $this->getChat()->getStatusLabel() ?></td>
                </tr>
                <tr>
                    <td class="label">
                        <a href="<?php echo $this->getChatViewUrl() ?>">
                            &gt; <?php echo $this->__('Details') ?>
                        </a>
                    </td>
                    <td class="value"></td>
                </tr>
            </table>
        <?php else: ?>
            <?php echo $this->__('There is no ticket associated to this order') ?><br />
            <button type="button" class="scalable add" onclick="setLocation('<?php echo $this->getCreateTicketUrl()?>')">
                <span><?php echo $this->__('Create ticket') ?></span>
            </button>
        <?php endif; ?>
    </div>
</div>
